import OrderByDTO from '@/api/entity/OrderByDTO'

export default class StoreOrderDetailQueryDTO extends OrderByDTO {
  // eslint-disable-next-line no-useless-constructor
  constructor () {
    super()
    this.state = []
  }

  static instance () {
    return new StoreOrderDetailQueryDTO()
  }

  /**
   * 设置state
   * @param {Array<String>} state
   */
  setState (state) {
    this.state = state
  }

  /**
   * 添加一个状态筛选
   * @param {String} state
   */
  addState (state) {
    if (state) {
      if (!this.state) {
        this.setState([state])
      } else {
        this.state.push(state)
      }
    }
  }
}
